package cn.syw.service;
import java.util.List;
import java.util.Map;

import cn.syw.dao.PermissionJdbcDaoImpl;
import cn.syw.dao.iface.PermissionDao;
import cn.syw.domain.Permission;
import cn.syw.service.iface.PermissionService;
public class PermissionServiceImpl implements PermissionService{
	PermissionDao permissionDao = new PermissionJdbcDaoImpl();
	@Override
	public List<Permission> getPermissions(String userName) {
		return permissionDao.getPersission(userName);
	}
	@Override
	public List<Map<String, Object>> queryPermission() {
		 List<Map<String, Object>> list = new PermissionJdbcDaoImpl().queryPermissions();
		return list;
	}
	@Override
	public Map<String, Object> queryById(String id) {
		Map<String, Object> permission = permissionDao.queryById(id);
		return permission;
	}
	@Override
	public int deletePermission(String id) {
		int num = permissionDao.deletePermission(id);
		return num;
	}
}
